package forkjoin;

public class ForkJoinDemo {
    /**
     * 求和计算
     * 3000 6000(ForkJoin) 9000(Stream并行流)
     * @param args
     */
    public long start;
    public long end;
    //临界值
    public long temp = 10000L;
    public ForkJoinDemo(Long start, Long end) {
        this.start = start;
        this.end = end;
    }
    public  void test() {
        if ((end-start)>temp) {
            //分支合并计算

        } else {
                int sum = 0;
                for (int i = 0; i < 10000; i++) {
                sum += i;
                }
            System.out.println(sum);
        }
    }
    public static void main(String[] args) {
//        int sum = 0;
//        for (int i = 0; i < 10000; i++) {
//            sum += i;
//        }
//        System.out.println(sum);
    }
}
